//
// Created by lenovo on 25-5-7.
//
#include "iostream"
#include "string"
using namespace std;
class MyPrint
{
public:
    //函数调用运算符重载
    void operator()(string test)
    {
        cout<<test<<endl;
    }
};
class MyAdd
{
public:
    int operator()(int num1,int num3)
    {
        return num1+num3;
    }
};
void Test01()
{
    MyPrint myPrint;
    myPrint("hello word");//使用起来非常类似于函数因此称为仿函数
}
void Test03()
{
    MyAdd myAdd;
    cout<<myAdd(4,4)<<endl;
}
int main()
{
    Test03();
    return 0;
}